var t = getApp();

Page({
    data: {
        details: {},
        quantity: "",
        points: 0
    },
    onLoad: function(t) {
        this.getStream();
    },
    setPoints: function() {
        var t = this.data.quantity * this.data.details.stream_eq_points;
        this.setData({
            points: t
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {
        var t = getCurrentPages();
        t[t.length - 2].getBehavior(!0);
    },
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    getStream: function() {
        var e = this, n = t.getNetAddresss("plugin.new-media-advertising.frontend.stream.exchange-stream-page");
        t._getNetWork({
            url: n,
            success: function(n) {
                var a = n.data;
                if (1 != a.result) return t.tips(a.msg);
                e.setData({
                    details: a.data
                });
            }
        });
    },
    send: function() {
        var e = t.getNetAddresss("plugin.new-media-advertising.frontend.stream.exchange-stream");
        t._getNetWork({
            url: e,
            data: {
                stream: this.data.quantity
            },
            success: function(e) {
                var n = e.data;
                t.tips(n.msg), 1 == n.result && setTimeout(function() {
                    wx.navigateBack();
                }, 500);
            }
        });
    }
});